Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Discovery: DID registration by clients #2709

Merged
merged 19 commits into from
Jan 16, 2024

Conversation

reinkrul
Copy link
Member

@reinkrul reinkrul commented Jan 3, 2024

Uses #2711

This PR adds functionality and an API for discovery clients to register DIDs on discovery services. Presentations are automatically refreshed when they are about to expire.

@reinkrul reinkrul force-pushed the discovery/client-service-registration branch 2 times, most recently from 17a6aae to 2b59760 Compare January 5, 2024 11:58
@reinkrul reinkrul marked this pull request as ready for review January 5, 2024 11:59
@reinkrul reinkrul requested review from gerardsn and woutslakhorst and removed request for gerardsn January 5, 2024 11:59
@reinkrul reinkrul force-pushed the discovery/client-service-registration branch 2 times, most recently from c910188 to 5c71ab5 Compare January 5, 2024 13:02
@reinkrul reinkrul force-pushed the discovery/client-service-registration branch from 0478cd6 to 8b553fb Compare January 9, 2024 10:11
discovery/interface.go Outdated Show resolved Hide resolved
docs/_static/discovery/v1.yaml Outdated Show resolved Hide resolved
e2e-tests/discovery/run-test.sh Show resolved Hide resolved
discovery/api/v1/wrapper.go Show resolved Hide resolved
discovery/client.go Outdated Show resolved Hide resolved
discovery/cmd/cmd.go Show resolved Hide resolved
discovery/config.go Outdated Show resolved Hide resolved
discovery/config.go Show resolved Hide resolved
discovery/client.go Outdated Show resolved Hide resolved
discovery/client.go Outdated Show resolved Hide resolved
discovery/api/v1/wrapper.go Outdated Show resolved Hide resolved
discovery/interface.go Outdated Show resolved Hide resolved
discovery/interface.go Outdated Show resolved Hide resolved
@@ -101,6 +116,7 @@ func (m *Module) Configure(_ core.ServerConfig) error {
}
m.serverDefinitions = serverDefinitions
}
m.httpClient = client.New(serverConfig.Strictmode, 10*time.Second, nil)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we need a default timeout in the serverConfig

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe, maybe not. Time-out could be client-specific?

Co-authored-by: Gerard Snaauw <[email protected]>
@reinkrul
Copy link
Member Author

reinkrul commented Jan 12, 2024

Changes to make things more understandable:

  • Renamed client-side registerDID and deregisterDID to activateServiceForDID and deactivateServiceForDID
  • Renamed registrationManager to clientRegistrationManager, scheduledRegistrationManager to defaultClientRegistrationManager
  • Renamed registrationManager's function to mirror activate rename
  • Renamed http.go to client.go
  • Renamed wrapper.go to api.go
  • Renamed Module.Add to Module.Register
  • Renamed sqlStore.updateDIDRegistrationTime to updatePresentationRefreshTime and sqlStore.getStaleDIDRegistrations to getPresentationsToBeRefreshed
  • Renamed SQL table discovery_did_registrations to discovery_presentation_refresh

@reinkrul reinkrul requested a review from gerardsn January 12, 2024 09:21
docs/_static/discovery/v1.yaml Outdated Show resolved Hide resolved
discovery/client.go Outdated Show resolved Hide resolved
@reinkrul reinkrul requested a review from gerardsn January 12, 2024 11:53
@reinkrul reinkrul merged commit 3a3032d into master Jan 16, 2024
8 of 9 checks passed
@reinkrul reinkrul deleted the discovery/client-service-registration branch January 16, 2024 13:49
rolandgroen added a commit that referenced this pull request Jan 25, 2024
* master: (38 commits)
  VDR: Fix duplicate results when listing DIDs (#2743)
  VDR: API to list owned DIDs (#2742)
  VDR: Move did:nuts specific to did:nuts creator (#2735)
  Discovery: API to list configured Discovery Services (#2739)
  PKI: Adjust validation logging; OK = trace, NOK = info (#2736)
  Discovery: update client copy of Discovery Services (#2718)
  VDR: Group all DID Document management funcs in a new interface (#2737)
  Handle direct_post return from wallet to verifier (#2702)
  Bump github.com/nats-io/nats.go from 1.31.0 to 1.32.0 (#2724)
  Discovery: fix API of Client.Search() (#2730)
  Bump github.com/amacneil/dbmate/v2 from 2.10.0 to 2.11.0 (#2729)
  Discovery: DID registration by clients (#2709)
  Config: Add HTTP-client timeout (#2725)
  Policy: prevent nil dereference when no backend is configured (#2723)
  Bump github.com/nats-io/nats-server/v2 from 2.10.7 to 2.10.9 (#2721)
  SQL: specify lengths for VARCHAR columns to avoid different behavior with different RDBMS's (#2717)
  Bump golang from 1.21.5-alpine to 1.21.6-alpine (#2719)
  Handle authorization request from verifier by holder/wallet (#2680)
  Bump golang.org/x/crypto from 0.17.0 to 0.18.0 (#2716)
  Bump github.com/lestrrat-go/jwx/v2 from 2.0.18 to 2.0.19 (#2715)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants